const App = {
    data() {
        return {
            photo,
            formData:{},
            tableData:[],
            ACCESSTOKEN:'',
            total: 0,
            loading: false,
            tableData:[],
        }
    },
    beforeCreate() {
        function setRem() {
            const designWidth = 750; // 设计稿宽度（rpx）
            const maxWidth = 540; // 可选：限制最大宽度（如手机端常见值）
            const screenWidth = Math.min(window.innerWidth, maxWidth);
            const scale = screenWidth / designWidth;
            document.documentElement.style.fontSize = scale + 'px';
        }
        setRem();//1rem = 0.5px 对标小程序在 375px 宽的屏幕上，1rpx = 0.5px（因为 750rpx / 375px = 2）
    },
    mounted() {
        let URL = window.location.href;
        this.ACCESSTOKEN = getQueryObject(URL, 'ACCESSTOKEN');
        let Blue_Plate_SerialNumber = getQueryObject(URL, 'Blue_Plate_SerialNumber');
        this.getList(Blue_Plate_SerialNumber);
    },
    methods: {
        getList(nodeKey) {
            console.log(`%${nodeKey}%`);
            $.ajax({
                headers: requestHeaders(),
                url: `${mh}/generalBusiness/generalQueryBySQLSerialNumber`,
                method: "POST",
                data: {
                    SQLSerialNumber: 'f_blue_plate_information_mini',
                    Condition: window.btoa(unescape(encodeURIComponent(`%${nodeKey}%`))),
                    ExtensionCondition:''
                },
                success: (data) => {
                    if (data.length == 1) {
                        this.formData = data[0];
                    }
                },
                complete: (XMLHttpRequest) => {
                    if (XMLHttpRequest.status == 302) {
                        wx.miniProgram.navigateTo({
                            url: miniProgram,
                        })
                    }
                },
            });
        }
    },
};

const { createApp } = Vue;
const app = createApp(App);
//这种方式是引入全部图标，无需单个引入
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component);
}
const ElMessage = ElementPlus.ElMessage;
app.use(ElementPlus, { locale: zhCn });
app.mount("#app");